package com.zzq.mapper;

import com.zzq.pojo.Tenderer;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TendererMapper {

    @Select("select * from tenderer where username=#{username}")
    Tenderer findByTendererName(String username);

    @Insert("insert into tenderer(username,password,name,contact_name,contact_phone,address,registration_date) values(#{username},#{password},#{companyName},#{name},#{phone},#{address},now())")
    void add(String username, String password, String companyName, String name, String phone,String address);

    @Select("select * from tenderer")
    List<Tenderer> list();

    @Delete("delete from tenderer where id=#{id}")
    void deleteTenderer(int id);

    @Update("update tenderer set name=#{name},contact_name=#{contactName},contact_phone=#{contactPhone},address=#{address} where id=#{id}")
    void enitTenderer(Tenderer tenderer);
}
